package com.gzhryc.net_marketing.core.enums;

public class GoodsOrderEnum {

    public enum State {
        Wait(1, "等待支付"), WaitDeliver(2, "等待发货"), WaitReceive(3, "等待收货")
            , ReturnGoods(4, "退换货"), WaitEvaluate(5, "等待评价")
            , Finish(6, "订单完成"), Close(7, "订单关闭"), Refund(8, "订单退款");

        private Integer index;
        private String note;

        State(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public static String note(Integer index) {
            GoodsOrderEnum.State[] temp = GoodsOrderEnum.State.values();
            for (int i = 0; i < temp.length; i++) {
                GoodsOrderEnum.State item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }

    public enum SupplyState {

        WaitConfirm(1, "等待确认"),WaitSupplierConfirm(2, "待供货商确认"),FinishConfirm(3, "完成确认")
        ,UnableToSupply(4, "无法供货");

        private Integer index;
        private String note;

        SupplyState(Integer index, String note) {
            this.index = index;
            this.note = note;
        }

        public Integer index() {
            return index;
        }

        public String note() {
            return note;
        }

        public Integer getIndex() {
            return index;
        }

        public String getNote() {
            return note;
        }

        public static String note(Integer index) {
            SupplyState[] temp = SupplyState.values();
            for (int i = 0; i < temp.length; i++) {
                SupplyState item = temp[i];
                if (item.index.equals(index)) {
                    return item.note;
                }
            }
            return null;
        }
    }
}
